﻿'========================================================================
'功能:
'作者:andy
'日期:
'========================================================================
Imports System.Data
Partial Class WebForm_Mail_AssetMaintainLog
    Inherits BasePage
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            hiUID.Value = ActualUID
            hiDBName.Value = dbName
            txtowner.Text = hiUID.Value

            'tCMain.ActiveTabIndex = 0



        End If

    End Sub



    'Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
    '    Me.AssetDetail1.InitDataAndShow()
    'End Sub



   
  
    Protected Sub btnQuery_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnQuery.Click
        gvMain.SelectedIndex = -1
        gvMain.Visible = True
        gvMain.DataBind()
    End Sub

    Protected Sub btnDetil_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        
    End Sub

    Protected Sub gvMain_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvMain.RowDataBound
        If e.Row.RowType = DataControlRowType.DataRow Then
            If e.Row.DataItem("assetdef_idChg").ToString() = "Y" Then
                e.Row.Cells(2).ForeColor = Drawing.Color.Red
            End If
            If e.Row.DataItem("asset_OwnerChg").ToString() = "Y" Then
                e.Row.Cells(5).ForeColor = Drawing.Color.Red
            End If
            If e.Row.DataItem("User1Chg").ToString() = "Y" Then
                e.Row.Cells(6).ForeColor = Drawing.Color.Red
            End If
            If e.Row.DataItem("ComputerNameChg").ToString() = "Y" Then
                e.Row.Cells(8).ForeColor = Drawing.Color.Red
            End If
            If e.Row.DataItem("ClassChg").ToString() = "Y" Then
                e.Row.Cells(9).ForeColor = Drawing.Color.Red
            End If
            If e.Row.DataItem("LocationChg").ToString() = "Y" Then
                e.Row.Cells(10).ForeColor = Drawing.Color.Red
            End If
        End If
    End Sub

    Protected Sub gvMain_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles gvMain.RowCommand
       
    End Sub

    Protected Sub gvMain_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles gvMain.SelectedIndexChanged

        AssetDetail1.Visible = True
        Dim serialNo As String = gvMain.DataKeys(gvMain.SelectedIndex)(0).ToString
        Dim seqNo As String = gvMain.DataKeys(gvMain.SelectedIndex)(1).ToString
        AssetDetail1.InitDataAndShow(serialNo, seqNo)

    End Sub

    Protected Sub gvMain_PageIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles gvMain.PageIndexChanged
        gvMain.SelectedIndex = -1
    End Sub
End Class
